import java.util.Scanner;

/**
 * @author: gao
 * @create-date: 2025/4/9 16:27
 */

public class Solution {
    public int numSubarrayProductLessThanK(int[] nums, int k) {
        int count = 0, product = 1;
        for (int right = 0, left = 0; right < nums.length; right++) {
            // 进窗口
            product *= nums[right];
            while (product >= k && left <= right) {
                // 更新结果
                product /= nums[left];
                // 出窗口
                left++;
            }
            // 计算以right为右端点的所有子数组的数量
            count += right - left + 1;
        }
        return count;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int len = in.nextInt();
            int[] nums = new int[len];
            for (int i = 0; i < len; i++) {
                nums[i] = in.nextInt();
            }
            int k = in.nextInt();
            Solution solution = new Solution();
            System.out.println(solution.numSubarrayProductLessThanK(nums, k));
        }
    }
}